package top.chj.day19.linkedlist;

import org.junit.Test;

import java.util.LinkedList;

/**
 * @Auther:小陈的Java
 */
public class Demo3 {
    @Test
    public void test1() {
        LinkedList<String> linkedList = new LinkedList<>();
        linkedList.add("a");
        linkedList.add("b");
        linkedList.add("c");
        linkedList.addFirst("A");
        System.out.println(linkedList);
        linkedList.addLast("C");
        System.out.println(linkedList);
        System.out.println(linkedList.getFirst());
        System.out.println(linkedList.getLast());
        System.out.println(linkedList);
        System.out.println(linkedList.removeFirst());
        System.out.println(linkedList.removeLast());
        System.out.println(linkedList);
    }
}
